#pragma once

template<class T>
class Singleton
{
public:
	~Singleton(void){}

	static T* GetInstance(void)
	{
		if (m_pInstance == 0)
		{
			m_pInstance = new T();
		}
		return m_pInstance;
	}

	static void Release(void)
	{
		if ( m_pInstance != 0 )
		{
			delete m_pInstance;
			m_pInstance = 0;
		}
	}

private:
	Singleton(void){}
	Singleton(const Singleton& instance){}
	const Singleton& operator=(const Singleton& rhs){}

	static T* m_pInstance;
};

template<class T>
T* Singleton<T>::m_pInstance = 0;